#include "obj_grass.h"

obj_grass::obj_grass (){
	texture=load_jpg_texture("./media/objects/obj_grass.jpg");
	if (texture==(GLuint)-1){
		debug("Can't find right picture");
		return;
	}

	col_verts.resize(4);
	verts.resize(4);
	faces.resize(2);
	UVs.resize(4);
	
	verts[0][0]=-OBJ_GRASS_LENGHT/2.;verts[0][1]=-OBJ_GRASS_WIDTH/2.;verts[0][2]=-0.9;
	verts[1][0]=+OBJ_GRASS_LENGHT/2.;verts[1][1]=-OBJ_GRASS_WIDTH/2.;verts[1][2]=-0.9;
	verts[2][0]=+OBJ_GRASS_LENGHT/2.;verts[2][1]=+OBJ_GRASS_WIDTH/2.;verts[2][2]=-0.9;
	verts[3][0]=-OBJ_GRASS_LENGHT/2.;verts[3][1]=+OBJ_GRASS_WIDTH/2.;verts[3][2]=-0.9;

	faces[0][0]=0;faces[0][1]=1;faces[0][2]=2;faces[0][3]=0;faces[0][4]=1;faces[0][5]=2;
	faces[1][0]=0;faces[1][1]=2;faces[1][2]=3;faces[1][3]=0;faces[1][4]=2;faces[1][5]=3;

	UVs[0][0]=0;UVs[0][1]=0;
	UVs[1][0]=100;UVs[1][1]=0;
	UVs[2][0]=100;UVs[2][1]=100;
	UVs[3][0]=0;UVs[3][1]=100;
	
	loaded=1;
	transparent=0;
	calc_r();
	collide=1;
	obj_type=OBJ_TYPE_GRASS;

}
